﻿@model S4Store.Models.Report.G1Item
@{
    Layout = null;
    ViewBag.Title = "Report1Item";
    var ratio = Model.Ratio * 2;
    if (ratio > 200)
    {
        ratio = 200;}
    if(ratio<0){
        ratio = 0;
    }
    decimal currml = 2;
    currml += (ratio - 25);
    if (currml < 0)
    {
        currml = 0;}
    if(currml>(222-50)){
        currml = (222 - 50);
    }
}
<div style="width:230px;display:inline-block">
<div style=" float:left; margin-top:10px; display:inline-block" class="@if (Model.IsStandard){<text>greenitem</text>}
                                                                       else
                                                                       {<text>reditem</text>}">
<div class="currvalue" style=" margin-left:@(currml)px;">
@Model.Text
</div>
@if (Model.IsStandard)
{
    <div class="reportcontainer">
        <div class="reportsuccess">
            <div class="l"></div>
            <div class="value" style="width:@(ratio)px"></div>
            <div class="r"></div>
        </div>
    </div>
}
else
{
    <div class="reportcontainer">
        <div class="reportfail">
            <div class="l"></div>
            <div class="value" style="width:@(ratio)px"></div>
            <div class="r"></div>
        </div>
    </div>
}
<div class="reportitemname">@(Model.Name)@if (!String.IsNullOrWhiteSpace(Model.Target))
                                         {<text>(目标：@Model.Target)</text> }</div>

</div>
</div>